import request from '@/utils/request.js';

// dataType
export function dataTypeGetService(requestUrl) {
    return request.get(requestUrl);
}

export function dataTypePostService(requestUrl, fieldName, inputName) {
    return request.post(requestUrl + "?" + fieldName + "=" + inputName);
}

export function dataTypeDeleteService(requestUrl, id) {
    return request.delete(requestUrl + "/" + id);
}

// message
export function messageGetService(reciverType, reciverId) {
    return request.get("/message/" + reciverType + "/" + reciverId);
}

// statistics
export function totalGetService() {
    return request.get("/stat/total");
}

export function houseStatGetService(orgId) {
    return request.get("/stat/house/" + orgId);
}

export function taskStatGetService(dateTimeRange) {
    return request.post("/stat/task", dateTimeRange);
}

export function workorderStatGetService(dateTimeRange) {
    return request.post("/stat/workorder", dateTimeRange);
}

// log
export function logGetService(currentPage, pageSize, dateRange) {
    return request.post("/log", { currentPage, pageSize, dateRange  })
}

